<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="org.apache.shiro.web.filter.authc.FormAuthenticationFilter"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<html>
<head>
    <title>登录页</title>
    <link rel="stylesheet" href="/css/bootstrap.min.css">
</head>

<script src="/js/jquery-2.0.3.min.js" type="text/javascript"></script>
<script src="/js/bootstrap.min.js"></script>

<body>
<div class="container" >
    <form id="loginForm" action="/man/login" method="post" class="form-horizontal">
        <%
            String error = (String) request.getAttribute(FormAuthenticationFilter.DEFAULT_ERROR_KEY_ATTRIBUTE_NAME);
            if(error != null){
        %>
        <div class="alert alert-error form-group">
            登录失败，请重试.
        </div>
        <%
            }
        %>
        <div class="form-group">
            <label for="username" class="col-sm-4 control-label">名称</label>
            <div class="col-sm-3">
                <input type="text" class="form-control" id="username" width="100px" name="username" value="${username}">
            </div>
            <div class="col-sm-5"></div>
        </div>
        <div class="form-group">
            <label for="password" class="col-sm-4 control-label">密码</label>
            <div class="col-sm-3">
                <input type="password" class="form-control" width="100px" id="password"  name="password" value="${password}">
            </div>
            <div class="col-sm-5"></div>
        </div>


        <div class="form-group">
            <div class="col-sm-offset-5 col-sm-7">
                <input id="submit_btn" class="btn btn-primary" type="submit" value="登录"/>
            </div>
        </div>
    </form>
</div>
</body>
</html>
